package com.zxl.yjb.activity;

import android.os.Bundle;
import android.view.View;
import android.webkit.WebSettings;
import android.webkit.WebView;
import android.widget.ImageView;
import android.widget.TextView;


import com.zxl.yjb.R;
import com.zxl.yjb.base.BaseActivity;

import butterknife.BindView;
import butterknife.ButterKnife;

/**
 * Created by ZLM on 2017/9/25.
 */

public class ProtocolActivity extends BaseActivity {

    @BindView(R.id.tv_page_title)
    TextView tv_page_title;
    @BindView(R.id.iv_back)
    ImageView iv_back;
    @BindView(R.id.wv_protocol)
    WebView wv_protocol;



    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_protocol);
        ButterKnife.bind(this);
        initView();
    }

    @Override
    protected void initView() {
        tv_page_title.setText("用户注册协议");
        iv_back.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                finish();
            }
        });

        wv_protocol.setInitialScale(50);
        WebSettings webSettings = wv_protocol.getSettings();

        webSettings.setJavaScriptEnabled(true);
        webSettings.setJavaScriptCanOpenWindowsAutomatically(true);
        webSettings.setBuiltInZoomControls(true);// support zoom
        webSettings.setUseWideViewPort(true);// 这个很关键
        webSettings.setLoadWithOverviewMode(true);
        wv_protocol.loadUrl("file:///android_asset/userxy.html");
    }
}
